package com.wbr.springboot.sbproject.dao;

import com.wbr.springboot.sbproject.mapper.MyMapper;
import com.wbr.springboot.sbproject.po.UserInfo;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface UserDao extends MyMapper<UserInfo> {

    @Select("select * from userInfo where username = #{username}")
    UserInfo getUserByName(@Param("username") String username);

    @Insert("insert into userinfo(username,password) values(#{username},#{password})")
    void AddUser(@Param("username") String username,@Param("password") String password);

    @Select("select * from userInfo")
    List<UserInfo> getAllUser();
}